package com.definesys.smecrailtransit.SmecManager.SmecKpManager;

import com.definesys.smecrailtransit.SmecApplication;
import com.kaopiz.kprogresshud.KProgressHUD;

/**
 * Created by xupeizuo on 2017/7/26.
 */

public final class SmecKpUtils {

    public static KProgressHUD kProgressHUD;

    static {
        _initKp();
    }

    private static void _initKp(){
        if(SmecApplication.getkProgressHUDs() == null || SmecApplication.getkProgressHUDs().size() == 0){
            return;
        }
        kProgressHUD=SmecApplication.getkProgressHUDs().get(SmecApplication.getkProgressHUDs().size()-1);
    }

    public static void showWithStatus(){
        if(kProgressHUD == null){
            return;
        }
        kProgressHUD.setStyle(KProgressHUD.Style.SPIN_INDETERMINATE);
        kProgressHUD.show();
    }

    public static void kpDismiss(){
        kProgressHUD.dismiss();
    }
}
